﻿<div>
    <div class="page-title" ng-init="systemPortfolio.initData()">
        Add/Edit System portfolio
    </div>

    <div id="container">
        <div class="numbered-title ng-scope">
            <div class="numbered-title-number floatLeft">1</div>
            <div class="numbered-title-text floatLeft">
                <div>
                    <div class="title-16-bold">Portfolio Name:</div>
                    <div style="position: relative; height: 60px;">
                        <div class="sarch-top" style="position: absolute;">
                            <div class="sustainalytics-searchbox" data-searchbox-service="SystemPortfolioSearchBoxServiceAdapter"
                                 data-searchbox-searchempty data-searchbox-text="systemPortfolio.portfolio.name">
                                <input type="text" ng-maxlength="100" id="portfolioAddSearchInput" class="inp-search sustainalytics-searchbox-input" style="float: left;" ng-model="search.searchData" placeholder="Portfolio Name">
                                <input type="button" id="searchPortfolioBtn" class="btn-search" style="float: left;" onclick=" $('#portfolioAddSearchInput').focus(); " ng-click="search.search(false)">
                                <div class="clear">&nbsp;</div>
                                <div class="search-results" ng-show="search.isVisible">
                                    <div class="search-results-inner sustainalytics-searchbox-results" style="height: 80px; overflow: auto;" ng-show="search.lastItemsCount > 0 || search.lastSkip > 0">
                                        <a href="" ng-repeat="item in search.items" ng-click="systemPortfolio.selectPortfolioAdd(item);$parent.search.searchData = item.name;
                                           $parent.search.isVisible = false;
                                           $event.stopPropagation();"><span ng-bind-html="item.markedContent"></span>{{item.name}}</a>
                                    </div>
                                    <p style="text-align: center; color: white; font-weight: bold; padding: 0 0 20px 0;" ng-show="search.skip == 0 && search.lastItemsCount == 0">
                                        No matches found
                                    </p>
                                </div>
                            </div>
                            <div class="clear">&nbsp;</div>
                        </div>
                    </div>

                </div>
                <div class="clear"></div>
            </div>
            <div class="clear">&nbsp;</div>
        </div>

        <div class="numbered-title ng-scope">
            <div class="numbered-title-number floatLeft">2</div>
            <div class="numbered-title-text floatLeft" style="width: 80%;">
                <div class="title-16-bold">
                    Standard Universes:
                    <!--<span class="reset_text">Company groups:</span>-->
                </div>                
                <div style="width: 100%; float: left; padding-right: 10%;">
                    <multi-select-tree data-input-model="systemPortfolio.allGroups" multi-select="true"
                                       data-output-model="systemPortfolio.selectedGroups"
                                       data-default-label="Click here to select..." data-select-only-leafs="true"></multi-select-tree>
                </div>
                <div class="clear"></div>
            </div>
            <div class="clear"></div>
        </div>

        <button class="btn-green" ng-disabled="!(systemPortfolio.selectedGroups.length) || !(systemPortfolio.portfolio.name.length)" ng-click="systemPortfolio.savePortfolio()">Save</button>
        <button class="btn-green" ng-click="systemPortfolio.cancel()">Cancel</button>
        <div class="clear">&nbsp;</div><br/>
    </div>
</div>